<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>职位搜索-高级搜索</title>
<link type="text/css" rel="stylesheet" href="css/searchJob.css" />
   <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<!--   <script type="text/javascript" src="js/searchJob.js"></script>-->
   <script type="text/javascript">
      $(document).ready(function () {
         $.get("/findAlljob",function (mess) {
               show(mess);
         });
         $("[name=shousuo]").click(function () {
            var pname=$("[name=pname]").val();
            $.get("/findAlljob",{"pname":pname},function (mess) {
               show(mess);
            });
         });

         $('.seachlist .tj1 span.list').click(function(){
            $('.seachlist .tj1').removeClass('on');
            $(this).addClass('on');
            $('.seachlist .tj1 span.zhaoyao').removeClass('on');
            $('table.listtab tr.xxdetail').addClass('none')
         })
         $('.seachlist .tj1 span.zhaoyao').click(function(){
            $('.seachlist .tj1').addClass('on');
            $(this).addClass('on');
            $('.seachlist .tj1 span.list').removeClass('on');
            $('table.listtab tr.xxdetail').removeClass('none');
         });

         $(document).on("click","a[name=index]",function () {
            var indexPage=$(this).attr("id");
            var pname=$("[name=pname]").val();
            $.get("/findAlljob",{"pname":pname,"indexpage":indexPage},function (mess) {
               show(mess);
            });
         });
         $("[name=shousuo]").click(function () {
            var pname=$("[name=pname]").val();
            $.get("/findAlljob",{"pname":pname},function (mess) {
               show(mess);
            })
         })





         function show(mess) {
            JSON.stringify(mess);

            var list=mess.data.list;
            $("[name=xx]").empty();
            $("[name=count]").empty();
            $("[name=countpage]").empty();
            $("[name=count]").html("共"+mess.data.total+"条数据");
            $("[name=countpage]").html("当前为"+mess.data.pageNum+"/"+mess.data.pages+"页");
            for (var i=0;i<list.length;i++){
               $("<tr><td><a href='/job_info?pid="+list[i].pid+"' class='jobname'>" + list[i].pname + "</a></td>\n<td>\n" +
                       "<div class='company'>" +
                       "<a href='company?pid="+list[i].pid+"'>"+list[i].enterprise.ename+"</a></div></td>" +
                       "<td></td>" +
                       "<td>"+list[i].location+"</td>" +
                       "<td><span>"+list[i].salary+"</span></td>" +
                       "<td>"+list[i].refresh_time+"</td>\n" +
                       "</tr>"+
                       "<tr class='xxdetail none'>" +
                       "<td colspan='5'>" +
                       "<div class='yaoqiu'>"+list[i].detail+"<br />"+list[i].duty+"<br />"+list[i].request+"</div>" +
                       "</td><td> <div class='applydiv'>"+
                        "<a href='/log'class='ljsqbtn'>立即申请</a>" +
                       "<span>关注</span>" +
                       "</div></td></tr>").appendTo("[name=xx]");
            }
            showpage(mess);

         }


      });
      function showpage(mess) {
         JSON.stringify(mess);
         $("[name=page]").empty();
         var pagehp=mess.data;
            $("<a name='index' id='"+1+"' class=\"fy1\">首页</a>").appendTo("[name=page]");
            if (!pagehp.isFristPage){
               $("<a name='index' id='"+pagehp.prePage+"' class='fy1'>上一页</a>").appendTo("[name=page]");
            }
            $("<a name='index' id='"+pagehp.pageNum+"' class=\"fy2 on\">"+pagehp.pageNum+"</a>").appendTo("[name=page]");
            if (pagehp.pages<10){
               for (var i=pagehp.pageNum;i<pagehp.pages;i++){
                  $("<a name='index' id='"+(pagehp.pageNum+i)+"' class='fy2 '>"+(pagehp.pageNum+i)+"</a>").appendTo("[name=page]");
               }
            }else {
               for (var i=pagehp.pageNum;i<10;i++){
                  $("<a name='index' id='"+(pagehp.pageNum+i)+"' class='fy2 '>"+(pagehp.pageNum+i)+"</a>").appendTo("[name=page]");
               }
            }
            if (!pagehp.isLastPage){
               $("<a name='index' id='"+pagehp.nextPage+"' class=\"fy1\">下一页</a>").appendTo("[name=page]");
            }
            $("<a name='index' id='"+pagehp.pages+"' class=\"fy1\">尾页</a>").appendTo("[name=page]");

         }


   </script>
</head>

<body>
<div class="topDiv">
  <div class="topL">
     <div class="logo">
        <a href="index.html">
           <img src="images/LOGO.png" />
           <img src="images/view_logo40.png" class="img1"/>
        </a>
     </div>
     <img src="images/spirit_40.png" />
  </div>
  <div class="topR">
     <div class="topR0 topR2"><a href="/register">注册</a></div>
     <div class="topR0 topR3"><a href="/log">个人登录</a></div>
     <div class="clear"></div>
  </div>
</div>
<div class="menuDiv">
   <div class="mainWarp">
   </div>
</div>
<div class="clear"></div>
<div class="menuLittle">
</div>
<div class="clear"></div>
<div class="searchDiv">
  <div class="search1">
    <div class="sea1_1">
       <input name="pname" type="text" placeholder="请填写职位关键词" class="keyword"/>
       <span class="jiantou"></span>
    </div>
    <div class="sea1_4">
       <a name="shousuo">搜工作</a>
    </div>
  </div>
</div>
<div class="clear"></div>
<div class="seachlist">
   <div class="listtop">
      <div class="tj1">
         <span class="list on">列表</span>
         <span class="zhaoyao">摘要</span>
      </div>
      <div  class="tj3">
         <span name="count">共1141条</span>
      </div>
   </div>
   <div class="clear"></div>
   <div class="listcon">
      <table border="0" width="100%" cellpadding="0" cellspacing="0" class="listtab">
         <thead>
           <tr>
              <th width="24%" style="padding-left:17px">职位名称</th>
              <th width="30%">企业名称</th>
              <th width="8%"></th>
              <th width="16%">工作地点</th>
              <th width="8%">薪水</th>
              <th width="10%">刷新时间</th>
           </tr>
         </thead>
         <tbody name="xx">
         </tbody>
      </table>
   </div>
   <div class="clear"></div>
   <div class="listbottom">
      <div class="lb3"><span name="countpage"></span></div>
   </div>
   <div class="clear"></div>
   <div name="page" class="fenyediv">
      <a href="javascript:void(0)" class="fy1">首页</a>
      <a href="javascript:void(0)" class="fy1">上一页</a>
      <a href="javascript:void(0)" class="fy2 on">1</a>
      <a href="javascript:void(0)" class="fy2">2</a>
      <a href="javascript:void(0)" class="fy2">3</a>
      <a href="javascript:void(0)" class="fy2">4</a>
      <a href="javascript:void(0)" class="fy2">5</a>
      <a href="javascript:void(0)" class="fy2">6</a>
      <a href="javascript:void(0)" class="fy2">7</a>
      <a href="javascript:void(0)" class="fy2">8</a>
      <a href="javascript:void(0)" class="fy2">9</a>
      <a href="javascript:void(0)" class="fy2">10</a>
      <a href="javascript:void(0)" class="fy1">下一页</a>
      <a href="javascript:void(0)" class="fy1">尾页</a>
   </div>
   <div class="clear"></div>
</div>
<div class="clear"></div>
<div class="footer">
</div>
</body>

</html>
